<template>
  <div>
    <h1>vuex-base2案例</h1>
    <button @click="changeAge">改年龄action</button>
    <Son1></Son1>
    <Son2></Son2>

  </div>
</template>
<script>
import Son1 from "./Son1.vue"
import Son2 from "./Son2.vue"
export default {
  components: { Son1, Son2 },
  methods: {
    changeAge() {
      // $store.dispatch("action的方法名",参数)
      this.$store.dispatch("changeAgeAction",1)
    }
  }
}
</script>